<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page session="true"%>
<%@page import="java.util.*"%>
<%@page import="tr.com.argela.tap.mot.models.Version"%>

<%@page import="tr.com.argela.tap.mot.models.User"%>

<%@page import="java.sql.*"%>
<%@page import="tr.com.argela.tap.mot.dao.VersionDao"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
   <html>
<head>

<title>JSP Page</title>
<link rel="stylesheet" type="text/css" href="style/styles.css">
</head>
<body>
  
  <%
     User user = (User)request.getSession().getAttribute("userObject");
     String name = user.getName();
     
%>
  <h4 align="right"><%=name%></h4>
  <h5 align="right"><a href="logout.jsp">Log out</a></h5>
       <dıv> <h1 align="center">MOT</h1><h5 align="center">Memory Of Testing</h5></dıv>
       	<dıv>
       <table border="1" align="center">

<tr><td><B>Version Names</B></td>


<% 
//call db method



VersionDao verDao = new VersionDao();

List<Version> versions = verDao.seeVersions();

for (Version version : versions) {
%> 

<td><a href="versionproperties.jsp?id15=<%=version.getId()%>"><%=version.getName()%></a></td>
<% }

%>
</tr> 

</table>
</dıv>
<br><br><br><br>
          <dıv align="left">
        <table align="left">
            <tr><td>
	        <h4><a href="currentProjects.jsp">Current Projects</a></h4>
	    </td></tr>
	      <tr><td>
	      	<h4><a href="createProject.jsp">Create Project</a></h4>
	    </td></tr>
	       <tr><td>
	         <h4><a href="projectVersion.jsp">Create Project Version</a></h4>
	    </td></tr>
	      <tr><td>
	         <h4><a href="versions.jsp">Project Versions</a></h4>
	    </td></tr>
	        <tr><td>
	          <h4><a href="users.jsp">Users</a></h4>
	    </td></tr>
	        <tr><td>
	           <h4><a href="export.jsp">Export Document</a></h4>
	    </td></tr>
        </table>
        </dıv>
        
     <dıv align="right">
<%
if(request.getParameter("id15")==null)
	response.sendRedirect("projectVersion.jsp");

VersionDao versionDao = new VersionDao();

Version version = versionDao.checkversions(Long.parseLong((String)request.getParameter("id15")));


%>
<table border="2" align="center">
<tr>
<th colspan="2" align="center">Version <%=version.getId()%>'s properties</th>
</tr>

<tr>
<th>Version ID</th>
<td><%=version.getId()%></td></tr>
<tr>
<th>Version Name</th>
<td>
<%=version.getName()%>
</td>
</tr><tr>
<th>Version Description</th>
<td>
<%=version.getDescription()%>
</td></tr><tr>
<th>Project Name</th>
<td>
<%=version.getProject().getName()%>
</td></tr><tr>
<th>Release Date</th>
<td>
<%=version.getRelease()%>
</td>
</tr>

</table>
</dıv></body></html>